/*  ___ _  ____  __ _  _    ___       _ _          
 * | _ \ |/ /  \/  | \| |  / _ \ _ _ | (_)_ _  ___ 
 * |  _/ ' <| |\/| | .` | | (_) | ' \| | | ' \/ -_)
 * |_| |_|\_\_|  |_|_|\_|  \___/|_||_|_|_|_||_\___|
 */
#ifndef __PKMNONLINE_AUDIO_H__
#define __PKMNONLINE_AUDIO_H__
#include <fmod.hpp>

FMOD::System *g_sys;

// TODO: Completely rebuild this class and rename to CAudioManager.

class CAudio {
public:
	static void Init()
	{
		FMOD_RESULT result;

		result = FMOD::System_Create(&g_sys);
		if (result != FMOD_OK)
			return;

		result = g_sys->init(100, FMOD_INIT_NORMAL, 0);
		if (result != FMOD_OK)
			return;
	}

	static void Play( const char *szFileName )
	{
		FMOD_RESULT result;

		FMOD::Sound *sound;
		result = g_sys->createSound(szFileName, FMOD_SOFTWARE, 0, &sound);		// Make the sound software mixed.

		FMOD::Channel *channel;
		result = g_sys->playSound(FMOD_CHANNEL_FREE, sound, false, &channel);
	}
};

#endif /* __PKMNONLINE_AUDIO_H__ */
